package com.usian.admin.controller;/*
 *文件名：LoginController
 *创建者：宋璟
 *创建时间:2023/2/6 16:05
 *描述: TODO
 */

import com.usian.admin.service.UserLoginService;

import com.usian.model.admin.dtos.AdUserDto;
import com.usian.model.admin.pojos.AdUser;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
public class LoginController  {

    @Autowired
    private UserLoginService userLoginService ;


    @PostMapping("/in")
    public ResponseResult login(@RequestBody AdUserDto dto){
        return userLoginService.login(dto);
    }

    @PostMapping("out")
    public ResponseResult logOut(@RequestParam String name){
        return ResponseResult.okResult(name);
    }
}